]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix overview sizing with multimonitor
authorGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 1 Mar 2013 23:00:59 +0000 (00:00 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 1 Mar 2013 23:29:13 +0000 (00:29 +0100)
Previously, the overview BoxLayout was sized and positioned explicitly
using the primary monitor coordinates, as its parent was at 0,0 and
with a fixed layout manager. Now we use a bin layout, so we need to
position and size the stack actor, and set the overview boxlayout to
expand.
Take also the occasion to use a MonitorConstraint instead of handling
position and size manually.

https://bugzilla.gnome.org/show_bug.cgi?id=694969

js/ui/overview.js

index 3ee87fa0bded614c94c23bf0d6629708a228cd1c..6f236081deed5b45c8d23191f1a7a943b8c736d1 100644 (file)
@@ -13,6 +13,7 @@ const Gdk = imports.gi.Gdk;
 const Background = imports.ui.background;
 const Dash = imports.ui.dash;
 const DND = imports.ui.dnd;
+const LayoutManager = imports.ui.layout;
 const Main = imports.ui.main;
 const MessageTray = imports.ui.messageTray;
 const OverviewControls = imports.ui.overviewControls;
@@ -120,13 +121,16 @@ const Overview = new Lang.Class({
 
         let layout = new Clutter.BinLayout();
         this._stack = new Clutter.Actor({ layout_manager: layout });
+        this._stack.add_constraint(new LayoutManager.MonitorConstraint({ primary: true }));
 
         /* Translators: This is the main view to select
            activities. See also note for "Activities" string. */
         this._overview = new St.BoxLayout({ name: 'overview',
                                             accessible_name: _("Overview"),
                                             reactive: true,
-                                            vertical: true });
+                                            vertical: true,
+                                            x_expand: true,
+                                            y_expand: true });
         this._overview._delegate = this;
 
         this._groupStack = new St.Widget({ layout_manager: new Clutter.BinLayout(),
@@ -442,12 +446,8 @@ const Overview = new Lang.Class({
         // when it is next shown.
         this.hide();
 
-        let primary = Main.layoutManager.primaryMonitor;
         let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex);
 
-        this._overview.set_position(primary.x, primary.y);
-        this._overview.set_size(primary.width, primary.height);
-
         this._coverPane.set_position(0, workArea.y);
         this._coverPane.set_size(workArea.width, workArea.height);